import java.util.Scanner;

public class project09 {
    public static void main(String[] args) {
        String Username = "user";
        String Password = "pass";
        Scanner scanner = new Scanner(System.in);
        int num = 3;

        while (num > 0) {
            System.out.print("请输入用户名: ");
            String username = scanner.nextLine();
            System.out.print("请输入密码: ");
            String password = scanner.nextLine();

            if (username.equals(Username) && password.equals(Password)) {
                System.out.println("登录成功!");
                return;
            } else {
               num--;
                System.out.println("登录失败，剩余尝试次数: " + num);
            }
        }

        System.out.println("超过最大尝试次数，账户锁定.");
        scanner.close();
    }
}
